<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>
    Function.prototype.myApply = function (thisArg, arrs) {
      const key = Symbol();
      thisArg[key] = this;
      const res = thisArg[key](...arrs);
      delete thisArg[key];
      return res;
    }

    const student = {
      name: 'xiaowu'
    }

    function func(num1, num2) {
      console.log(this);
      console.log(num1, num2);
      return num1 + num2;
    }

    console.log(func.myApply(student, [1, 2]));
  </script>
</body>

</html>